home *** CD-ROM | disk | FTP | other *** search
- // the declaration of CKBANView
- // Copyright (C) 1997 Kazutaka Hirata <khirata@jove.acs.unt.edu>
-
- #ifndef _NEWVIEW_H_
- #define _NEWVIEW_H_
-
- // stdafx.h should be included already.
-
- #include "cmd/deffunc.h"
- #include "cmd/dlpin.h"
- #include "cmd/dlline.h"
- #include "cmd/dlcomp.h"
- #include "cmd/edblock.h"
- #include "cmd/edblockl.h"
- #include "cmd/edpaste.h"
- #include "cmd/edpin.h"
- #include "cmd/edpull.h"
- #include "cmd/eddivide.h"
- #include "cmd/edmvline.h"
- #include "cmd/plpin.h"
- #include "cmd/plline.h"
- #include "cmd/plcomp.h"
- #include "cmd/sugrid.h"
-
- #include "grid.h"
- #include "kbandoc.h"
- #include "kbanfunc.h"
-
- #define HIDDEN_STRING_LEN 100
-
- class CKBANView : public CScrollView
- {
- DECLARE_DYNCREATE(CKBANView)
- private:
- KBAN_FUNCTION* m_current_mmi;
- DEFAULT_FUNC m_default_func;
- EDIT_BLOCK m_edit_block;
- EDIT_BLOCK_LAYER m_edit_block_layer;
- EDIT_PASTE m_edit_paste;
- EDIT_PULL m_edit_pull;
- EDIT_DIVIDE m_edit_divide;
- EDIT_MOVE_LINE m_edit_move_line;
- EDIT_PIN m_edit_pin;
- SETUP_GRID_ORIGIN m_setup_grid_origin;
- PLACE_PIN m_place_pin;
- PLACE_LINE m_place_line;
- PLACE_COMPONENT m_place_component;
- DELETE_PIN m_delete_pin;
- DELETE_LINE m_delete_line;
- DELETE_COMPONENT m_delete_component;
- uint m_moved;
- XY m_dc_old;
- XY m_pc_old;
- UINT m_nGridID;
- UINT m_nLayerID;
- bool m_bDisableRedraw;
- char m_hidden_string[HIDDEN_STRING_LEN + 1];
- typedef (KBAN_FUNCTION::*MOUSE_FUNC)(KBAN_INFO& info, KBAN_DRAW& draw, const XY& pc, UINT nFlags);
-
- PIN_ELEMENT* m_ctxt_target_pin;
- LINE_ELEMENT* m_ctxt_target_line;
- COMPONENT_ELEMENT* m_ctxt_target_comp;
- public:
- CKBANView();
- CKBANDoc* GetDocument() { return (CKBANDoc*)m_pDocument; }
- protected:
- void ChangeCommandCore(KBAN_INFO& info, KBAN_DRAW& draw, KBAN_FUNCTION* func);
- void ChangeCommand(KBAN_FUNCTION* func);
- virtual void OnDraw(CDC*);
- virtual void OnInitialUpdate();
- virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- void OnMouseGeneral(UINT nFlags, CPoint point, MOUSE_FUNC func);
- afx_msg void OnMouseMove (UINT nFlags, CPoint point);
- afx_msg void OnLButtonUp (UINT nFlags, CPoint point);
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnRButtonUp (UINT nFlags, CPoint point);
- afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- enum SCROLL_DIRECTION {
- SCROLL_UP ,
- SCROLL_DOWN ,
- SCROLL_LEFT ,
- SCROLL_RIGHT
- };
- void OnScrollCore(SCROLL_DIRECTION sd);
- afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnMove(int x, int y);
- afx_msg void OnVScroll(UINT nCode, UINT nPos, CScrollBar* pScrollBar);
- afx_msg void OnHScroll(UINT nCode, UINT nPos, CScrollBar* pScrollBar);
-
- // edit
- afx_msg void OnUndo();
- afx_msg void OnUpdateUndo(CCmdUI* pCmdUI);
- afx_msg void OnRedo();
- afx_msg void OnUpdateRedo(CCmdUI* pCmdUI);
- afx_msg void OnEditCutCopyDelete(UINT nID);
- afx_msg void OnUpdateCutCopyDelete(CCmdUI* pCmdUI);
- afx_msg void OnEditUnselectAll();
- afx_msg void OnUpdateUnselectAll(CCmdUI* pCmdUI);
- afx_msg void OnUpdatePaste(CCmdUI* pCmdUI);
-
- // view
- afx_msg void OnZoomCore(UINT nID);
- afx_msg void OnRedraw();
- afx_msg void OnChangeSnap();
- afx_msg void OnUpdateSnap(CCmdUI* pCmdUI);
- afx_msg void OnChangePinOnCommon();
- afx_msg void OnUpdatePinOnCommon(CCmdUI* pCmdUI);
- afx_msg void OnChangeFill();
- afx_msg void OnUpdateFill(CCmdUI* pCmdUI);
- afx_msg void OnChangeHole();
- afx_msg void OnUpdateHole(CCmdUI* pCmdUI);
- afx_msg void OnHelpDebug();
- afx_msg void OnToolsPurge();
- afx_msg void OnChangeGrid(UINT nID);
- afx_msg void OnUpdateGrid(CCmdUI* pCmdUI);
- afx_msg void OnSetGridWidth();
- afx_msg void OnResetGrid();
- afx_msg void OnAptPin();
- afx_msg void OnAptLine();
-
- // context
- afx_msg void OnContextEditPin();
- afx_msg void OnContextSelectPin();
- afx_msg void OnContextUnselectPin();
- afx_msg void OnContextSelectLine();
- afx_msg void OnContextUnselectLine();
- afx_msg void OnContextSelectComponent();
- afx_msg void OnContextUnselectComponent();
- public:
- afx_msg void OnChangeLayer(UINT nID);
- protected:
- afx_msg void OnUpdateLayer(CCmdUI* pCmdUI);
- afx_msg void OnChangeShowLayer(UINT nID);
- afx_msg void OnUpdateShowLayer(CCmdUI* pCmdUI);
- afx_msg void OnChangeCommand(UINT nID);
- afx_msg void OnIsEmpty();
- afx_msg void OnUserMessage(UINT wParam, LONG lParam);
-
- // status bar
- afx_msg void OnUpdateIndicatorX(CCmdUI* pCmdUI);
- afx_msg void OnUpdateIndicatorY(CCmdUI* pCmdUI);
- afx_msg void OnUpdateIndicatorLayer(CCmdUI* pCmdUI);
- afx_msg void OnUpdateIndicatorZoom(CCmdUI* pCmdUI);
- afx_msg void OnUpdateIndicatorGrid(CCmdUI* pCmdUI);
- afx_msg void OnUpdateIndicatorCommand(CCmdUI* pCmdUI);
- DECLARE_MESSAGE_MAP()
- };
-
- #endif /* _NEWVIEW_H_ */
-